﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NIF.MobileActors.Core
{
    [Serializable]
    public struct ActorID
    {
        public static ActorID NewAgentID()
        {
            ActorID id = new ActorID();
            id.guid = Guid.NewGuid();
            return id;
        }

        public override bool Equals(object obj)
        {
            if (!(obj is ActorID))
                return false;
            return guid == ((ActorID)obj).guid;
        }

        public override int GetHashCode()
        {
            return guid.GetHashCode();
        }

        public override string ToString()
        {
            return guid.ToString();
        }

        public static bool operator ==(ActorID id1, ActorID id2)
        {
            return id1.guid == id2.guid;
        }

        public static bool operator !=(ActorID id1, ActorID id2)
        {
            return !(id1 == id2);
        }

        private Guid guid;
    }
}
